<!doctype html>
<html>

<head>
    <template source='TPL:admin.common.head' />
</head>

<body>
    <div class="wrap">
        <div class="nav">
            <ul class="cc">
                <li class="current"><a href="{@WindUrlHelper::createUrl('/app/torrent/manage/run')}">基本设置</a></li>
                <li><a href="{@WindUrlHelper::createUrl('/app/torrent/manage/agent')}">客户端设置</a></li>
                <li><a href="{@WindUrlHelper::createUrl('/app/torrent/manage/credit')}">积分设置</a></li>
                <li><a href="{@WindUrlHelper::createUrl('/app/torrent/manage/type')}">资源类型绑定</a></li>
            </ul>
        </div>
        <form method="post" class="J_ajaxForm" action="{@WindUrlHelper::createUrl('/app/torrent/manage/dorun')}">
            <div class="h_a">展示设置</div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col width="400" />
                    <col />
                    <tr>
                        <th>展示Tracker信息</th>
                        <td>
                            <ul class="one_list cc">
                                <li>
                                    <label>
                                        <input name="showuserinfo[]" type="checkbox" value="headerinfo" {@pw::ifcheck(is_array($config['app.torrent.showuserinfo']) && in_array('headerinfo' ,$config['app.torrent.showuserinfo']))}><span>顶部个人信息</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="showuserinfo[]" type="checkbox" value="threadside" {@pw::ifcheck(is_array($config['app.torrent.showuserinfo']) && in_array('threadside' ,$config['app.torrent.showuserinfo']))}><span>帖子页边栏</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="showuserinfo[]" type="checkbox" value="profile" {@pw::ifcheck(is_array($config['app.torrent.showuserinfo']) && in_array('profile' ,$config['app.torrent.showuserinfo']))}><span>个人资料页</span>
                                    </label>
                                </li>
                            </ul>
                        </td>
                        <td>
                            <div class="fun_tips">选择在哪些页面展示用户Trakcer数据</div>
                        </td>
                    </tr>
                    <!--# if($config['theme.site.default']=='pt') { #-->
                    <tr>
                        <th>展示Peer信息</th>
                        <td>
                            <ul class="one_list cc">
                                <li>
                                    <label>
                                        <input name="showpeers[]" type="checkbox" value="index" {@pw::ifcheck(is_array($config['app.torrent.showpeers']) && in_array('index' ,$config['app.torrent.showpeers']))}><span>站点默认首页</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="showpeers[]" type="checkbox" value="forum_my" {@pw::ifcheck(is_array($config['app.torrent.showpeers']) && in_array('forum_my' ,$config['app.torrent.showpeers']))}><span>我的版块帖子列表</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="showpeers[]" type="checkbox" value="cate" {@pw::ifcheck(is_array($config['app.torrent.showpeers']) && in_array('cate' ,$config['app.torrent.showpeers']))}><span>一级板块帖子列表</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="showpeers[]" type="checkbox" value="widget" {@pw::ifcheck(is_array($config['app.torrent.showpeers']) && in_array('widget' ,$config['app.torrent.showpeers']))}><span>二级板块帖子列表</span>
                                    </label>
                                </li>
                            </ul>
                        </td>
                        <td>
                            <div class="fun_tips">选择在哪些页面展示种子Peer信息</div>
                        </td>
                    </tr>
                    <!--# } #-->
                </table>
            </div>
            <div class="h_a">发布设置</div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col width="400" />
                    <col />
                    <tr>
                        <th>标题生成器</th>
                        <td>
                            <ul class="switch_list cc">
                                <li>
                                    <label>
                                        <input type="radio" name="titlegenenabled" value="2" {@pw::ifcheck($config['app.torrent.titlegen.enabled']==2 )}><span>强制</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input type="radio" name="titlegenenabled" value="1" {@pw::ifcheck($config['app.torrent.titlegen.enabled']==1 )}><span>开启</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input type="radio" name="titlegenenabled" value="0" {@Pw::ifcheck($config['app.torrent.titlegen.enabled']==0 )}><span>关闭</span>
                                    </label>
                                </li>
                            </ul>
                        </td>
                        <td>
                            <div class="fun_tips">是否开启标题生成器，选择“强制”则用户不能手动设置种子贴标题</div>
                        </td>
                    </tr>
                    <tr>
                        <th>豆瓣 API Key</th>
                        <td>
                            <input name="titlegendouban" type="text" class="input length_5" value="{$config['app.torrent.titlegen.douban']}">
                        </td>
                        <td>
                            <div class="fun_tips">豆瓣 API 请求频率限制为150次/分钟，设置 apikey 可以提高限制到 500次/分钟</div>
                        </td>
                    </tr>
                    <tr>
                        <th>OMDb Poster API Key</th>
                        <td>
                            <input name="titlegenomdb" type="text" class="input length_5" value="{$config['app.torrent.titlegen.omdb']}">
                        </td>
                        <td>
                            <div class="fun_tips">只有设置 OMDb Poster API Key 才能获取 OMDb(IMDB) 海报图片</div>
                        </td>
                    </tr>
                    <tr>
                        <th>AniDB API Client</th>
                        <td>
                            <input name="titlegenanidb" type="text" class="input length_5" value="{$config['app.torrent.titlegen.anidb']}">
                        </td>
                        <td>
                            <div class="fun_tips">只有设置 AniDB API Client 才能使用 AniDB API</div>
                        </td>
                    </tr>
                    <tr>
                        <th>发布前动作</th>
                        <td>
                            <ul class="one_list cc">
                                <li>
                                    <label>
                                        <input name="check[]" type="checkbox" value="deniedfts" {@pw::ifcheck(is_array($config['app.torrent.check']) && in_array('deniedfts' ,$config['app.torrent.check']))}><span>检查禁止的文件类型</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input name="check[]" type="checkbox" value="source" {@pw::ifcheck(is_array($config['app.torrent.check']) && in_array('source' ,$config['app.torrent.check']))}><span>添加网站信息（用户需要重新下载种子）</span>
                                    </label>
                                </li>
                            </ul>
                        </td>
                        <td>
                            <div class="fun_tips">选择发布帖子前对种子文件进行哪些附加处理</div>
                        </td>
                    </tr>
                    <!--# if (is_array($config['app.torrent.check']) && in_array('deniedfts', $config['app.torrent.check'])) { #-->
                    <tr>
                        <th>禁止的文件类型</th>
                        <td>
                            <div class="cross">
                                <ul id="J_ul_list_deniedfts" class="J_ul_list_public">
                                    <li>
                                        <span class="span_3">后缀名(小写)</span>
                                    </li>
                                    <!--# if (is_array($config['app.torrent.deniedfts'])) { #-->
                                    <!--# foreach ($config['app.torrent.deniedfts'] as $deniedft) { #-->
                                    <li>
                                        <span class="span_3"><input name="deniedfts[]" type="text" class="input length_2" value="{$deniedft}"></span>
                                        <span class="span_4"><a href="#" class="J_ul_list_remove">[删除]</a></span>
                                    </li>
                                    <!--# } #-->
                                    <!--# } #-->
                                </ul>
                            </div>
                            <a href="" class="link_add J_ul_list_add" data-related="deniedfts">添加文件类型</a>
                        </td>
                        <td>
                            <div class="fun_tips">禁止发布的文件类型（扩展名），用户发布种子时系统会自动检查</div>
                        </td>
                    </tr>
                    <!--# } #-->
                </table>
            </div>
            <div class="h_a">下载设置</div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col width="400" />
                    <col />
                    <tr>
                        <th>Tracker服务器</th>
                        <td>
                            <input name="trackerserver" type="text" class="input length_5" placeholder="https://tracker.example.com/%s" value="{$config['app.torrent.trackerserver']}">
                        </td>
                        <td>
                            <div class="fun_tips">以 http(s) 开头，以 %s 代表 passkey，如 https://tracker.example.com/%s</div>
                        </td>
                    </tr>
                    <tr>
                        <th>日志留存</th>
                        <td>
                            <ul class="switch_list cc">
                                <li>
                                    <label>
                                        <input type="radio" name="logenabled" value="1" {@pw::ifcheck($config['app.torrent.log']==1 )}><span>开启</span>
                                    </label>
                                </li>
                                <li>
                                    <label>
                                        <input type="radio" name="logenabled" value="0" {@Pw::ifcheck($config['app.torrent.log']==0 )}><span>关闭</span>
                                    </label>
                                </li>
                            </ul>
                        </td>
                        <td>
                            <div class="fun_tips">是否开启日志留存，若开启将保留每次tracker数据</div>
                        </td>
                    </tr>
                    <tr>
                        <th>种子文件前缀</th>
                        <td>
                            <input name="torrentnameprefix" type="text" class="input length_5" value="{$config['app.torrent.torrentnameprefix']}">
                        </td>
                        <td>
                            <div class="fun_tips">用户下载种子时将会自动添加到文件名前</div>
                        </td>
                    </tr>
                </table>
            </div>
            <!--# if ($cronList['ClearPeers']['isopen'] > 0 || $cronList['ClearTorrents']['isopen'] > 0) { #-->
            <div class="h_a">计划任务设置</div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col width="400" />
                    <col />
                    <!--# if ($cronList['ClearPeers']['isopen'] > 0) { #-->
                    <tr>
                        <th>Peer超时</th>
                        <td>
                            <input name="peertimeout" type="text" class="input length_5" value="{$config['app.torrent.cron.peertimeout']}">
                        </td>
                        <td>
                            <div class="fun_tips">单位 分钟，必须大于15</div>
                        </td>
                    </tr>
                    <!--# } #-->
                    <!--# if ($cronList['ClearTorrents']['isopen'] > 0) { #-->
                    <tr>
                        <th>断种清理天数</th>
                        <td>
                            <input name="torrenexpired" type="text" class="input length_5" value="{$config['app.torrent.cron.torrenexpired']}">
                        </td>
                        <td>
                            <div class="fun_tips">设为 0 关闭，建议通过停用相关计划任务关闭本功能</div>
                        </td>
                    </tr>
                    <!--# } #-->
                </table>
            </div>
            <!--# } #-->
            <div class="btn_wrap">
                <div class="btn_wrap_pd">
                    <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
                </div>
            </div>
        </form>
        <template source='TPL:admin.common.footer' />
    </div>
    <script>
    var _li_html = '<li><span class="span_3"><input type="text" value="" class="input length_2" name="deniedfts[]"></span><span class="span_4"><a class="J_ul_list_remove" href="#">[删除]</a></span></li>';
    </script>
</body>

</html>
